API Documentation
Classes | Typedefs | Enumerations
nkWinUi Namespace Reference

Encompasses all API of component NilkinsWinUi. More...

Classes

class  Button
 A graphical button. More...
 
struct  ChangeEventData
 Data holder for a change event. More...
 
class  CheckBox
 A graphical check box. More...
 
struct  ClickEventData
 Data holder for a click event. More...
 
class  Color
 Represents a color. More...
 
class  ComboBox
 A graphical combo box. More...
 
class  Component
 Base class for any graphical component. More...
 
class  ComponentManager
 Manages the components within nkWinUi. More...
 
class  ContentLoader
 Allows to export and import content through their declaration files. More...
 
class  ContextMenu
 A graphical context menu. More...
 
class  Cursor
 WIP. More...
 
class  CursorManager
 WIP. More...
 
class  EditBox
 A graphical single line edit box. More...
 
class  FileExplorer
 A graphical file explorer. More...
 
class  FontManager
 WIP. More...
 
class  GraphicsWindow
 A graphical window made to receive 3d rendering contexts. More...
 
class  GridLayout
 Implements a layout organizing children components in a grid. More...
 
class  GroupBox
 A graphical group box. More...
 
struct  HandledEventData
 Data holder for a handled event. More...
 
class  InputSystem
 Input system, centralizing default behaviour for the input. More...
 
struct  KeyEventData
 Data holder for a key event. More...
 
class  Layout
 Represents a layout to organize sub-windows in a window. More...
 
class  ListBox
 A graphical list box. More...
 
class  LogManager
 Responsible for logging all messages from the component. More...
 
class  LogWin
 A graphical logging window. More...
 
class  MainSystem
 The main system of the component. More...
 
class  MenuBar
 A graphical menu bar, appended on top of windows. More...
 
struct  MouseMoveEventData
 Data holder for a mouse move event. More...
 
class  MultiLineEdit
 A graphical multi line edit box. More...
 
class  Popup
 A graphical popup window. More...
 
class  ProgressBar
 WIP. More...
 
class  RelativeLayout
 Implements a layout positioning its children components relative to each other. More...
 
class  ScrollBar
 A graphical scroll bar. More...
 
class  Slider
 WIP. More...
 
class  Static
 A graphical static text zone. More...
 
class  StructToString
 Offers utilities to convert from structures or enums to strings, and vice versa. More...
 
class  TabWindow
 A graphical tab window. More...
 
class  Theme
 A theme used to style the windows in the component. More...
 
struct  ThemeColors
 Information about all the colors a theme will need. More...
 
class  ThemeManager
 Manages the themes within the component. More...
 
class  TreeView
 A graphical tree view window. More...
 
struct  WheelEventData
 Data holder for a wheel event. More...
 
class  Window
 A graphical window. More...
 

Typedefs

using mouseMoveCallback = std::function< bool(Component *caller, int absX, int absY, int relX, int relY, int moveX, int moveY)>
 Used by components for a mouse moved event. More...
 
using mouseClickCallback = std::function< bool(Component *caller, const ClickEventData &eventData)>
 Used by components for a mouse click event. More...
 
using mouseLeaveCallback = std::function< bool(Component *caller, const nkMaths::Point &absCoords)>
 Used by components when the mouse leaves their area. More...
 
using keyDownCallback = std::function< bool(Component *caller, KEY_CODE keyCode, bool autoRepeated)>
 Used by component when a keyboard key is pressed down. More...
 
using keyUpCallback = std::function< bool(Component *caller, KEY_CODE keyCode)>
 Used by component when a keyboard key is released. More...
 
using menuBarCallback = std::function< bool(Component *caller, int index)>
 Used by a nkWinUi::MenuBar to signal an item has been clicked. More...
 
using buttonClickCallback = std::function< bool(Button *caller)>
 Used by a nkWinUi::Button to signal it has been clicked. More...
 
using checkBoxCallback = std::function< bool(CheckBox *caller)>
 Used by a nkWinUi::CheckBox to signal it has been checked / unchecked. More...
 
using treeSelectionCallback = std::function< bool(TreeView *caller, void *itemData)>
 Used by a nkWinUi::TreeView to signal a selection occurred inside. More...
 
using listBoxSelectionCallback = std::function< bool(ListBox *caller)>
 Used by a nkWinUi::ListBox to signal a selection occurred inside. More...
 
using comboSelectionCallback = std::function< bool(ComboBox *caller)>
 Used by a nkWinUi::ComboBox to signal selection changed. More...
 
using editBoxKeyCallback = std::function< bool(EditBox *caller, const KeyEventData &key)>
 Used by a nkWinUi::EditBox to signal a key has been pressed inside. More...
 
using tabWindowCallback = std::function< bool(TabWindow *caller, bool changing)>
 Used by a nkWinUi::TabWindow when a tab switch is occurring. More...
 
using closeCallback = std::function< bool(Component *caller)>
 Used by a component to signal when it's closed. More...
 
using resizeCallback = std::function< bool(Component *caller)>
 Used by a component upon resize. More...
 
using contextMenuCreationCallback = std::function< bool(Component *caller, int absX, int absY)>
 Used by components when they need a context menu to be created. More...
 
typedef bool(* runRoutine) ()
 A callback for the running routine. Called when the loop from MainSystem::run() is running.
 

Enumerations

enum  COMPONENT_TYPE : unsigned int {
  COMPONENT_TYPE::BUTTON = 0, COMPONENT_TYPE::CHECK_BOX, COMPONENT_TYPE::COMBO_BOX, COMPONENT_TYPE::CONTEXT_MENU,
  COMPONENT_TYPE::EDIT_BOX, COMPONENT_TYPE::FILE_EXPLORER, COMPONENT_TYPE::GRAPHICS_WINDOW, COMPONENT_TYPE::GROUP_BOX,
  COMPONENT_TYPE::LIST_BOX, COMPONENT_TYPE::LOG_WIN, COMPONENT_TYPE::MULTI_LINE_EDIT, COMPONENT_TYPE::POPUP,
  COMPONENT_TYPE::PROGRESS_BAR, COMPONENT_TYPE::SCROLL_BAR, COMPONENT_TYPE::SLIDER, COMPONENT_TYPE::STATIC,
  COMPONENT_TYPE::TAB_WIN, COMPONENT_TYPE::TREE_VIEW, COMPONENT_TYPE::WINDOW
}
 Available component types. More...
 
enum  POPUP_TYPE {
  POPUP_TYPE::POPUP_TYPE_OK = 0, POPUP_TYPE::POPUP_TYPE_OK_CANCEL, POPUP_TYPE::POPUP_TYPE_ABORT_RETRY_IGNORE, POPUP_TYPE::POPUP_TYPE_YES_NO_CANCEL,
  POPUP_TYPE::POPUP_TYPE_YES_NO, POPUP_TYPE::POPUP_TYPE_RETRY_CANCEL, POPUP_TYPE::POPUP_TYPE_CANCEL_TRY_CONTINUE, POPUP_TYPE::POPUP_TYPE_HELP = 0x4000L
}
 Types of popup available. More...
 
enum  POPUP_RESULT {
  POPUP_RESULT::POPUP_RESULT_UNKNOWN = 0, POPUP_RESULT::POPUP_RESULT_OK, POPUP_RESULT::POPUP_RESULT_CANCEL, POPUP_RESULT::POPUP_RESULT_ABORT,
  POPUP_RESULT::POPUP_RESULT_RETRY, POPUP_RESULT::POPUP_RESULT_IGNORE, POPUP_RESULT::POPUP_RESULT_YES, POPUP_RESULT::POPUP_RESULT_NO,
  POPUP_RESULT::POPUP_RESULT_TRY_AGAIN = 10, POPUP_RESULT::POPUP_RESULT_CONTINUE
}
 Result answers possible from a popup. More...
 
enum  CHANGE_TYPE { CHANGE_TYPE::CHANGE_UNKNOWN = 0, CHANGE_TYPE::CHANGE_TEXT = 1, CHANGE_TYPE::CHANGE_NEW_UNDO = 2, CHANGE_TYPE::CHANGE_NEW_REDO = 4 }
 Describes a change nature. More...
 
enum  EVENT_TYPE { EVENT_TYPE::EVENT_UNKNOWN = 0, EVENT_TYPE::EVENT_MOUSE_CLICK, EVENT_TYPE::EVENT_MOUSE_MOVE, EVENT_TYPE::EVENT_KEY }
 Represents an event type. More...
 
enum  MOUSE_BUTTON {
  MOUSE_BUTTON::MOUSE_LEFT = 0x0001, MOUSE_BUTTON::MOUSE_MIDDLE = 0x0010, MOUSE_BUTTON::MOUSE_RIGHT = 0x0002, MOUSE_BUTTON::MOUSE_X1 = 0x0020,
  MOUSE_BUTTON::MOUSE_X2 = 0x0040
}
 A mouse button identifier. More...
 
enum  KEY_CODE {
  KEY_UNKNOWN = 0, KEY_BACKSPACE = 0x08, KEY_TAB, KEY_CLEAR = 0x0C,
  KEY_RETURN, KEY_SHIFT = 0x10, KEY_CONTROL, KEY_MENU,
  KEY_PAUSE, KEY_CAPITAL, KEY_KANA, KEY_KANJI = 0x19,
  KEY_ESCAPE = 0x1B, KEY_SPACE = 0x20, KEY_UP_PAGE, KEY_DOWN_PAGE,
  KEY_END, KEY_HOME, KEY_LEFT, KEY_UP,
  KEY_RIGHT, KEY_DOWN, KEY_SELECT, KEY_PRINT,
  KEY_EXEC, KEY_PRINT_SCREEN, KEY_INSERT, KEY_DEL,
  KEY_HELP, KEY_0, KEY_1, KEY_2,
  KEY_3, KEY_4, KEY_5, KEY_6,
  KEY_7, KEY_8, KEY_9, KEY_A = 0x41,
  KEY_B, KEY_C, KEY_D, KEY_E,
  KEY_F, KEY_G, KEY_H, KEY_I,
  KEY_J, KEY_K, KEY_L, KEY_M,
  KEY_N, KEY_O, KEY_P, KEY_Q,
  KEY_R, KEY_S, KEY_T, KEY_U,
  KEY_V, KEY_W, KEY_X, KEY_Y,
  KEY_Z, KEY_LEFT_WINDOWS, KEY_RIGHT_WINDOWS, KEY_APPS,
  KEY_SLEEP = 0x5F, KEY_0_NUMPAD, KEY_1_NUMPAD, KEY_2_NUMPAD,
  KEY_3_NUMPAD, KEY_4_NUMPAD, KEY_5_NUMPAD, KEY_6_NUMPAD,
  KEY_7_NUMPAD, KEY_8_NUMPAD, KEY_9_NUMPAD, KEY_MULT,
  KEY_ADD, KEY_SEPARATOR, KEY_SUBSTRACT, KEY_DECIMAL,
  KEY_DIVIDE, KEY_F1
}
 A key code identifier. More...
 
enum  LAYOUT_TYPE { LAYOUT_TYPE::UNKNOWN = 0, LAYOUT_TYPE::GRID, LAYOUT_TYPE::RELATIVE }
 Defines the type of layout available. More...
 
enum  RELATIVE_POSITION {
  RELATIVE_POSITION::UNKNOWN = 0, RELATIVE_POSITION::LEFT, RELATIVE_POSITION::RIGHT, RELATIVE_POSITION::OVER,
  RELATIVE_POSITION::UNDER, RELATIVE_POSITION::OVER_LEFT, RELATIVE_POSITION::OVER_RIGHT, RELATIVE_POSITION::UNDER_LEFT,
  RELATIVE_POSITION::UNDER_RIGHT
}
 Represents different positions, compared to an anchor. More...
 

Detailed Description

Encompasses all API of component NilkinsWinUi.

This component offers capabilities to create and populate windows from the system UI. Note that currently, only supported system is Windows through the WinAPI.

Typedef Documentation

◆ mouseMoveCallback

using nkWinUi::mouseMoveCallback = typedef std::function<bool (Component* caller, int absX, int absY, int relX, int relY, int moveX, int moveY)>

Used by components for a mouse moved event.

The callback will be called by the component, which will provide all the parameters about the event.

Parameters
callerThe calling component.
absXThe mouse x coordinate, absolute, on screen.
absYThe mouse y coordinate, absolute, on screen.
relXThe mouse x coordinate, relative to calling component.
relYThe mouse y coordinate, relative to calling component.
moveXThe x delta since last mouse moved event.
moveYthe y delta since last mouse moved event.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ mouseClickCallback

using nkWinUi::mouseClickCallback = typedef std::function<bool (Component* caller, const ClickEventData& eventData)>

Used by components for a mouse click event.

The callback will be called by the component, which will provide all the parameters about the event.

Parameters
callerThe calling component.
eventDataAll needed information about the event.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ mouseLeaveCallback

using nkWinUi::mouseLeaveCallback = typedef std::function<bool (Component* caller, const nkMaths::Point& absCoords)>

Used by components when the mouse leaves their area.

The callback will be called by the component, which will provide all the parameters about the event.

Parameters
callerThe calling component.
absCoordsThe absolute coordinates at which the mouse left the component.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ keyDownCallback

using nkWinUi::keyDownCallback = typedef std::function<bool (Component* caller, KEY_CODE keyCode, bool autoRepeated)>

Used by component when a keyboard key is pressed down.

The callback will be called by the component, which will provide all the parameters about the event.

Parameters
callerThe calling component.
keyCodeThe code of the key pushed.
autoRepeatedWhether this event is fired because the key is being auto repeated (long press).
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ keyUpCallback

using nkWinUi::keyUpCallback = typedef std::function<bool (Component* caller, KEY_CODE keyCode)>

Used by component when a keyboard key is released.

The callback will be called by the component, which will provide all the parameters about the event.

Parameters
callerThe calling component.
Thecode of the key released.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ menuBarCallback

using nkWinUi::menuBarCallback = typedef std::function<bool (Component* caller, int index)>

Used by a nkWinUi::MenuBar to signal an item has been clicked.

Parameters
callerThe calling component.
indexThe index attached to the item clicked.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ buttonClickCallback

using nkWinUi::buttonClickCallback = typedef std::function<bool (Button* caller)>

Used by a nkWinUi::Button to signal it has been clicked.

Parameters
callerThe calling component.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ checkBoxCallback

using nkWinUi::checkBoxCallback = typedef std::function<bool (CheckBox* caller)>

Used by a nkWinUi::CheckBox to signal it has been checked / unchecked.

Parameters
Thecalling component. Its state will reflect the new change.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ treeSelectionCallback

using nkWinUi::treeSelectionCallback = typedef std::function<bool (TreeView* caller, void* itemData)>

Used by a nkWinUi::TreeView to signal a selection occurred inside.

Parameters
callerThe calling component.
itemDataThe user data attached to the item selected.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ listBoxSelectionCallback

using nkWinUi::listBoxSelectionCallback = typedef std::function<bool (ListBox* caller)>

Used by a nkWinUi::ListBox to signal a selection occurred inside.

Parameters
callerThe calling component. Its state will reflect the new change.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ comboSelectionCallback

using nkWinUi::comboSelectionCallback = typedef std::function<bool (ComboBox* caller)>

Used by a nkWinUi::ComboBox to signal selection changed.

Parameters
Thecalling component. Its state will reflect the new change.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ editBoxKeyCallback

using nkWinUi::editBoxKeyCallback = typedef std::function<bool (EditBox* caller, const KeyEventData& key)>

Used by a nkWinUi::EditBox to signal a key has been pressed inside.

Parameters
callerThe calling component.
keyThe information about the event.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ tabWindowCallback

using nkWinUi::tabWindowCallback = typedef std::function<bool (TabWindow* caller, bool changing)>

Used by a nkWinUi::TabWindow when a tab switch is occurring.

Parameters
callerThe calling component.
changingIf the tab is being changed, or if it already changed.
Returns
Callback should return whether the tab shift can occur (true) or not (false).
Remarks
This function is called twice : once when it's changing, to request if change is allowed. And then once the change occurred.

◆ closeCallback

using nkWinUi::closeCallback = typedef std::function<bool (Component* caller)>

Used by a component to signal when it's closed.

Parameters
callerThe calling component.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ resizeCallback

using nkWinUi::resizeCallback = typedef std::function<bool (Component* caller)>

Used by a component upon resize.

Parameters
callerThe calling component.
Returns
Callback should return whether the event has been handled (true) or not (false).

◆ contextMenuCreationCallback

using nkWinUi::contextMenuCreationCallback = typedef std::function<bool (Component* caller, int absX, int absY)>

Used by components when they need a context menu to be created.

Parameters
callerThe calling component.
absXThe absolute x position where the menu should be created.
absYThe absolute y position where the menu should be created.
Returns
Callback should return whether the event has been handled (true) or not (false).

Enumeration Type Documentation

◆ COMPONENT_TYPE

enum nkWinUi::COMPONENT_TYPE : unsigned int
strong

Available component types.

Enumerator
BUTTON 

A Button.

CHECK_BOX 

A CheckBox.

COMBO_BOX 

A ComboBox.

CONTEXT_MENU 

A ContextMenu.

EDIT_BOX 

An EditBox.

FILE_EXPLORER 

A FileExplorer.

GRAPHICS_WINDOW 

A GraphicsWindow.

GROUP_BOX 

A GroupBox.

LIST_BOX 

A ListBox.

LOG_WIN 

A LogWin.

MULTI_LINE_EDIT 

A MultiLineEdit.

POPUP 

A Popup.

PROGRESS_BAR 

A ProgressBar.

SCROLL_BAR 

A ScrollBar.

SLIDER 

A Slider.

STATIC 

A Static.

TAB_WIN 

A TabWindow.

TREE_VIEW 

A TreeView.

WINDOW 

A Window.

◆ POPUP_TYPE

enum nkWinUi::POPUP_TYPE
strong

Types of popup available.

Enumerator
POPUP_TYPE_OK 

A simple informative popup with an ok button.

POPUP_TYPE_OK_CANCEL 

A popup requesting for agreement.

POPUP_TYPE_ABORT_RETRY_IGNORE 

A popup requesting if something should be aborted, retried, or ignored.

POPUP_TYPE_YES_NO_CANCEL 

A popup requesting for agreement or cancelling.

POPUP_TYPE_YES_NO 

A popup requesting for agreement.

POPUP_TYPE_RETRY_CANCEL 

A popup asking to retry or cancel.

POPUP_TYPE_CANCEL_TRY_CONTINUE 

A Popup requesting to cancel, try, or continue.

POPUP_TYPE_HELP 

A Popup showing a help tooltip.

◆ POPUP_RESULT

enum nkWinUi::POPUP_RESULT
strong

Result answers possible from a popup.

Enumerator
POPUP_RESULT_UNKNOWN 

Unknown place holder.

POPUP_RESULT_OK 

User clicked ok.

POPUP_RESULT_CANCEL 

User clicked cancel.

POPUP_RESULT_ABORT 

User clicked abort.

POPUP_RESULT_RETRY 

User clicked retry.

POPUP_RESULT_IGNORE 

User clicked ignore.

POPUP_RESULT_YES 

User clicked yes.

POPUP_RESULT_NO 

User clicked no.

POPUP_RESULT_TRY_AGAIN 

User clicked try.

POPUP_RESULT_CONTINUE 

User clicked continue.

◆ CHANGE_TYPE

enum nkWinUi::CHANGE_TYPE
strong

Describes a change nature.

Enumerator
CHANGE_UNKNOWN 

Unknown place holder change.

CHANGE_TEXT 

A change in text.

CHANGE_NEW_UNDO 

An undo change.

CHANGE_NEW_REDO 

A redo change.

◆ EVENT_TYPE

enum nkWinUi::EVENT_TYPE
strong

Represents an event type.

Enumerator
EVENT_UNKNOWN 

Unknown place holder.

EVENT_MOUSE_CLICK 

A mous click.

EVENT_MOUSE_MOVE 

A mouse move.

EVENT_KEY 

A key press / release.

◆ MOUSE_BUTTON

enum nkWinUi::MOUSE_BUTTON
strong

A mouse button identifier.

Enumerator
MOUSE_LEFT 

Left mouse button.

MOUSE_MIDDLE 

Middle mouse button.

MOUSE_RIGHT 

Right mouse button.

MOUSE_X1 

Mouse x1 button. Often taken as "previous" button.

MOUSE_X2 

Mouse x2 button. Often taken as "next" button.

◆ KEY_CODE

A key code identifier.

Based on Microsoft API key codes.

Enumerator
KEY_UNKNOWN 

Unknown place holder. Unseen in Microsoft API.

KEY_BACKSPACE 

Backspace (erase) key.

KEY_RETURN 

Return (enter) key.

◆ LAYOUT_TYPE

enum nkWinUi::LAYOUT_TYPE
strong

Defines the type of layout available.

Enumerator
UNKNOWN 

A Layout whose type is unknown. Should never be encountered.

GRID 

A grid layout.

RELATIVE 

A relative layout.

◆ RELATIVE_POSITION

Represents different positions, compared to an anchor.

Enumerator
UNKNOWN 

By default, when unknown. Not relative to anything.

LEFT 

Left of anchor.

RIGHT 

Right of anchor.

OVER 

Over, top of the anchor.

UNDER 

Under the anchor.

OVER_LEFT 

Top left (diagonal) of the anchor.

OVER_RIGHT 

Top right (diagonal) of the anchor.

UNDER_LEFT 

Under left (diagonal) of the anchor.

UNDER_RIGHT 

Under right (diagonal) of the anchor.